<?php
set_include_path($_SERVER ['DOCUMENT_ROOT']);
include_once 'admin/includes/functions/admin-functions.php';

$res = "{}";
if (isset($_POST['type']) && isset($_POST['id'])) {
    switch ($_POST['type']) {
        case 'city':
            $action = "Get_CitiesByProvince";
            $data = [
                'userAccount' => 10000,
                'provinceId' => $_POST['id']
            ];
            $response_data = $Cardclient->CallHttpPost($action, $data);
            if ($response_data['status']===0) {
                //var_dump($response_data['data']);
                $res = $response_data['data'];
            }
            break;
        case 'country':
            $action = "Get_CountyByCity";
            $data = [
                'userAccount' => 10000,
                'cityId' => $_POST['id']
            ];
            $response_data = $Cardclient->CallHttpPost($action, $data);
            if ($response_data['status']===0) {
                $res = $response_data['data'];
            }
            break;
        default:
            break;
    }
}
echo $res;
die();
